{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import cv2\n",
    "import numpy as np\n",
    "img = cv2.imread('image0.jpg',1)\n",
    "imgInfo = img.shape\n",
    "height = imgInfo[0]\n",
    "width = imgInfo[1]\n",
    "dstImg = np.zeros((height,width,3),np.uint8)\n",
    "# 进行颜色映射 用新的rgb代替原先的rgb\n",
    "# 通过公式将图片蓝色化 b=b*1.5 g=g*1.3\n",
    "for i in range(0,height):\n",
    "    for j in range(0,width):\n",
    "        (b,g,r) = img[i,j]\n",
    "        b = b*1.5\n",
    "        g = g*1.3\n",
    "        if b>255:\n",
    "            b = 255\n",
    "        if g>255:\n",
    "            g = 255\n",
    "        dstImg[i,j] = (b,g,r)\n",
    "        \n",
    "cv2.imshow('dstImg',dstImg)\n",
    "cv2.waitKey(0)\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
